//
//  Double+Extension.swift
//  letu
//
//  Created by gaoguangxiao on 2022/5/14.
//

import Foundation

extension Double {
    func roundTo(places:Int) -> Double {
        let divisor = pow(10.0, Double(places))
        return (self * divisor).rounded() / divisor        
    }
    
    
    func doubleToString() -> String {
        return NSString(format: "%.2f",self) as String
    }
}
